Skip to content

Add environment-aware new thread picker - #4426

Open
colonelpanic8 wants to merge 6 commits into
pingdotgg:mainfrom
colonelpanic8:t3code/remote-environment-thread-creation
Open

Add environment-aware new thread picker#4426
colonelpanic8 wants to merge 6 commits into
pingdotgg:mainfrom
colonelpanic8:t3code/remote-environment-thread-creation

Conversation

@colonelpanic8

@colonelpanic8 colonelpanic8 commented Jul 24, 2026

Copy link
Copy Markdown

What Changed

  • Added a chat.newEnvironment command on Mod+Shift+N.
  • Added a two-stage new-thread flow: choose an environment, then choose a project available on that environment.
  • Presents every environment in one flat Run on list; the primary environment is labeled with its runtime hostname instead of Local.
  • Keeps existing Mod+N project/context behavior unchanged.
  • Migrates only the previous exact Mod+Shift+N chat.newLocal default while preserving custom chat.newLocal bindings.

Why

Thread creation previously collapsed projects across environments and silently selected one machine. This makes execution location explicit without treating local as a separate mode.

UI Changes

Environment selection:

Choose an environment

Environment-scoped project selection:

Choose a project

Checklist

  • Focused keybinding and environment-grouping tests pass (92 tests).
  • Targeted formatting and lint checks pass.
  • Integrated web verification covers environment -> project -> draft.
  • Repository-wide vp check completes with only existing warnings outside this change.
  • Repository-wide vp run typecheck is blocked by the existing interactive Astro dependency prompt and existing unrelated web type errors; changed packages/files introduce no reported type errors.

Note

Medium Risk
Default shortcut behavior changes for all users who relied on Mod+Shift+N for instant local threads; migration is narrow but still touches persisted keybinding config on startup.

Overview
Mod+Shift+N now runs chat.newEnvironment, opening the command palette on a “New thread on…” flow instead of immediately starting a local thread. chat.newLocal remains available for custom bindings but is no longer the default on that chord.

The palette adds a flat Run on list of environments (with per-environment project submenus), waits until environment shells are bootstrapped before opening, and closes if nothing is available. Project rows are built with targetEnvironmentId so choices stay on the chosen machine rather than falling back to another environment’s project.

On the server, startup keybinding sync migrates only the exact legacy default (mod+shift+n + chat.newLocal + !terminalFocus) to chat.newEnvironment, leaving other chat.newLocal entries (e.g. mod+shift+l) untouched. Contracts and settings expose chat.newEnvironment via exported STATIC_KEYBINDING_COMMANDS.

Reviewed by Cursor Bugbot for commit 5e2155e. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add environment-aware new thread picker with chat.newEnvironment command

  • Adds a 'New thread on...' flow to the command palette that lets users pick an environment and project before starting a thread, triggered by mod+shift+n via the new chat.newEnvironment command.
  • Updates DEFAULT_KEYBINDINGS in shared/src/keybindings.ts to bind mod+shift+n to chat.newEnvironment instead of chat.newLocal.
  • Extends buildSidebarProjectPickerEntries to accept an optional targetEnvironmentId, scoping project entries to that environment without falling back to other machines.
  • Migrates existing user keybinding configs at startup: if the legacy chat.newLocal default is found without a chat.newEnvironment binding, it is automatically replaced.
  • Behavioral Change: mod+shift+n now opens the environment picker palette instead of directly creating a local thread; users with customized chat.newLocal bindings on other keys are unaffected.

Macroscope summarized 5e2155e.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: aa6d1f79-adec-4771-85b7-9bada1d7ab6a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Jul 24, 2026
Comment thread apps/web/src/components/CommandPalette.tsx Outdated
@macroscopeapp

macroscopeapp Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR introduces a new feature with significant new UI flows, command palette logic, keybinding changes, and migration behavior. The scope and complexity of new user-facing behavior warrant human review.

You can customize Macroscope's approvability policy. Learn more.

Comment thread apps/web/src/components/CommandPalette.logic.ts
@colonelpanic8
colonelpanic8 force-pushed the t3code/remote-environment-thread-creation branch from f1dd61f to cf4f7c9 Compare July 24, 2026 06:04
@colonelpanic8
colonelpanic8 force-pushed the t3code/remote-environment-thread-creation branch 2 times, most recently from fb31222 to 139d17e Compare July 25, 2026 00:04
Comment thread apps/web/src/components/CommandPalette.tsx
@colonelpanic8
colonelpanic8 force-pushed the t3code/remote-environment-thread-creation branch from 1b619d5 to a93d1ea Compare July 25, 2026 03:23
Comment thread apps/web/src/components/CommandPalette.tsx Outdated
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 25, 2026
Original local work that existed only in the pingdotgg#4426 stack-compat patch; no
topic branch defines it. CommandPalette.tsx imports these three symbols.
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 26, 2026
# Conflicts:
#	apps/web/src/commandPaletteBus.ts
#	apps/web/src/components/CommandPalette.logic.test.ts
#	apps/web/src/components/CommandPalette.tsx
#	apps/web/src/environmentGrouping.test.ts
#	apps/web/src/keybindings.test.ts
#	packages/contracts/src/keybindings.test.ts
#	packages/shared/src/keybindings.ts
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 26, 2026
Adds pingdotgg#4590 to the thread-picker group rather than the main
manifest: it edits the same CommandPalette trio, and specifically the
browse/submit region that pingdotgg#4257 and pingdotgg#4426 also touch, so the combination
resolves once against upstream main instead of being re-derived every refresh.

Group rebuilt (reproduce) to b15922f and repinned in stack.toml; main stack
refreshed. The group rebuild reproduced tree bad6ae3 across two independent
runs, and the assembled tree keeps every pingdotgg#4590 gating site plus the composer
path-search error.

The one non-mechanical resolution: the group had already extracted the palette
empty-state ternary into `contextualEmptyStateMessage` +
`resolveCommandPaletteEmptyStateMessage`, so pingdotgg#4590's inline branch was rewritten
onto that helper instead of taking either side verbatim.
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 27, 2026
# Conflicts:
#	apps/web/src/commandPaletteBus.ts
#	apps/web/src/components/CommandPalette.logic.test.ts
#	apps/web/src/components/CommandPalette.tsx
#	apps/web/src/environmentGrouping.test.ts
#	apps/web/src/keybindings.test.ts
#	packages/contracts/src/keybindings.test.ts
#	packages/shared/src/keybindings.ts
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 27, 2026
… and pingdotgg#4599

The published build already carried pingdotgg#4605 and pingdotgg#4599 -- stack-build-info.json on
t3code/stack lists both -- but the manifest edits that admitted them were never
committed here, so the recorded intent had drifted from the artifact and a
rebuild would have dropped two features. Restore them at the OIDs the published
build resolved, then append pingdotgg#4624.

pingdotgg#4624 is closed upstream without merging; carried because the replay cost is
real on this phone. Its head carries a fix past the PR: the 200ms code-highlight
debounces could never fire, because a growing code block's React key encodes its
source offsets and the block remounts on every delta.

Also refresh two pins that the artifact had moved past (the thread-picker group
and local/nix-flake), and re-audit the exception set: the group rebuild at
c5a4a73 shrank the CommandPalette losses on pingdotgg#4263/pingdotgg#4258/pingdotgg#4426 from 29/28/19
to 3/3/4. pingdotgg#4590's waiver is rewritten -- its 32 missing lines are an unbuilt
branch revision, not a resolution loss, because the group is still pinned at the
older member head.
@colonelpanic8
colonelpanic8 force-pushed the t3code/remote-environment-thread-creation branch from a93d1ea to a1a1520 Compare July 27, 2026 11:15
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 27, 2026
# Conflicts:
#	apps/web/src/commandPaletteBus.ts
#	apps/web/src/components/CommandPalette.logic.test.ts
#	apps/web/src/components/CommandPalette.tsx
#	apps/web/src/environmentGrouping.test.ts
#	apps/web/src/keybindings.test.ts
#	packages/contracts/src/keybindings.test.ts
#	packages/shared/src/keybindings.ts
Comment thread apps/web/src/components/CommandPalette.tsx Outdated
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 27, 2026
# Conflicts:
#	apps/web/src/commandPaletteBus.ts
#	apps/web/src/components/CommandPalette.logic.test.ts
#	apps/web/src/components/CommandPalette.tsx
#	apps/web/src/environmentGrouping.test.ts
#	apps/web/src/keybindings.test.ts
#	packages/contracts/src/keybindings.test.ts
#	packages/shared/src/keybindings.ts
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 27, 2026
All 41 writable topics were rebased onto upstream b4680cb and force-pushed,
so every pin here moved. The thread-picker group was rebuilt at the new member
heads, which also clears the stale-pin gap that had pingdotgg#4590's newer revision
sitting in no build.

Two cumulative branches -- t3code/client-suite (37 commits) and
t3code/unify-environment-selection (41) -- were replayed as a single
content-identical commit each rather than rebased commit-by-commit. They rewrite
their own files repeatedly, so each intermediate replay conflicted against a
state present in no final tree and with no oracle to resolve it against; that is
how the sidebar host-name and accent-color features were lost once before.
Applying base..tip instead reproduced both contributions exactly -- verified line
for line: 113 files / 6269 added lines and 131 files / 6686 added lines, both
unchanged. Old heads are preserved under refs/refresh-backup/.

Removed stack/patches/t3code-command-palette-logic-helpers.patch from the group
manifest. It predated the members carrying those helpers themselves: it deleted
shouldHandleCommandPaletteShortcut and shouldClearAddProjectEnvironmentOnPop and
stripped isLoaded from resolveNewThreadOnIntent, while adding three helpers
nothing in the assembled tree calls. Once the members were rebased, the
assembled CommandPalette.tsx imported both deleted symbols, and the web build
failed with two MISSING_EXPORT errors. Dropping it also shrank the audited
CommandPalette losses on pingdotgg#4263/pingdotgg#4258/pingdotgg#4426 from 10/7/7 to 3/3/4.

Added patches/t3code-dedupe-environment-icon.patch. client-suite and
unify-environment-selection each add the same EnvironmentIcon helper to
BranchToolbarEnvironmentSelector.tsx; git merges both without conflict and the
result fails to parse. Genuinely stack-emergent, so it cannot live on either
topic. Only the esbuild syntax gate catches this class -- the content audit
looks for missing lines, not duplicated ones.

pingdotgg#4624 is now a branch-linked topic with no `pr` key: it was closed upstream
without merging, so the branch is authoritative and the entry must not be
dropped on account of the PR's state.

Ladder: syntax gate clean, content audit exits 0, nix build exits 0, smoke
check exits 0.
@colonelpanic8
colonelpanic8 force-pushed the t3code/remote-environment-thread-creation branch from a1a1520 to 9394441 Compare July 28, 2026 02:07
@colonelpanic8
colonelpanic8 force-pushed the t3code/remote-environment-thread-creation branch from 9394441 to 6ace64e Compare July 28, 2026 02:51

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6ace64e. Configure here.

Comment thread packages/shared/src/keybindings.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant